/*
 * Copyright (C) 2017 Pingan, Inc. All Rights Reserved.
 */

package com.pingan.haofang.searchcloud.indexdatasource.dto;


/**
 * RPC索引构建DTO
 *
 * @author zhangbi617
 * @date 08/05/2017
 */
public class RpcIndexDataSourceDTO {

    private Long id;

    /**
     * rpc的URL
     */
    private String rpcUrl;

    /**
     * rpc对应方法名
     */
    private String rpcMethod;

    /**
     * 启用某个字段
     */
    private String indexField;

    /**
     * 增量时，使用哪个字段作为数据版本号字段，来定时拉取数据
     */
    private String versionField;

    /**
     * 分页大小
     */
    private int pageSize;

    /**
     * 起始页码
     */
    private int startPage;


    /**
     * 运行cron表达式,目前该字段不使用
     */
    private String cron = "";

    /**
     * 缓冲区状态 0：正常 1：停用
     */
    private Integer bufferStatus = 1;

    /**
     * 缓冲区最大容量
     */
    private Integer bufferSize = 0;

    /**
     * 最大等待时间，毫秒
     */
    private Integer maxWaitTime = 0;

    /**
     * 线程数量，大于1时开启多线程
     */
    private Integer threadNum;

    /**
     * 是否查询优化，1是，0否
     */
    private Integer queryOptimize;


    public String getRpcUrl() {
        return rpcUrl;
    }

    public void setRpcUrl(String rpcUrl) {
        this.rpcUrl = rpcUrl;
    }

    public String getRpcMethod() {
        return rpcMethod;
    }

    public void setRpcMethod(String rpcMethod) {
        this.rpcMethod = rpcMethod;
    }

    public String getIndexField() {
        return indexField;
    }

    public void setIndexField(String indexField) {
        this.indexField = indexField;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getStartPage() {
        return startPage;
    }

    public void setStartPage(int startPage) {
        this.startPage = startPage;
    }

    public String getCron() {
        return cron;
    }

    public void setCron(String cron) {
        this.cron = cron;
    }

    public Integer getBufferStatus() {
        return bufferStatus;
    }

    public void setBufferStatus(Integer bufferStatus) {
        this.bufferStatus = bufferStatus;
    }

    public Integer getBufferSize() {
        return bufferSize;
    }

    public void setBufferSize(Integer bufferSize) {
        this.bufferSize = bufferSize;
    }

    public Integer getMaxWaitTime() {
        return maxWaitTime;
    }

    public void setMaxWaitTime(Integer maxWaitTime) {
        this.maxWaitTime = maxWaitTime;
    }

    public Integer getThreadNum() {
        return threadNum;
    }

    public void setThreadNum(Integer threadNum) {
        this.threadNum = threadNum;
    }

    public Integer getQueryOptimize() {
        return queryOptimize;
    }

    public void setQueryOptimize(Integer queryOptimize) {
        this.queryOptimize = queryOptimize;
    }

    @Override
    public String toString() {
        return "RpcIndexDataSourceDTO{" +
                "id=" + id +
                ", rpcUrl='" + rpcUrl + '\'' +
                ", rpcMethod='" + rpcMethod + '\'' +
                ", indexField='" + indexField + '\'' +
                ", versionField='" + versionField + '\'' +
                ", pageSize=" + pageSize +
                ", startPage=" + startPage +
                ", cron='" + cron + '\'' +
                ", bufferStatus=" + bufferStatus +
                ", bufferSize=" + bufferSize +
                ", maxWaitTime=" + maxWaitTime +
                ", threadNum=" + threadNum +
                ", queryOptimize=" + queryOptimize +
                '}';
    }

    public String getVersionField() {
        return versionField;
    }

    public void setVersionField(String versionField) {
        this.versionField = versionField;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

}
